<template>
	<div id="">
		<span id="1" style="display: none;">
			{{current.userId}}
		</span>
		<div id="">
			<h3>戍码分期</h3>
			<van-cell-group>
			  <van-cell title="服务项目" :value="projectService.name" />
			  <van-cell title="价格" :value="projectService.amount" />
			  <van-cell title="付款方式" :value="paymentOptions.name" />
			  <van-cell title="状态" :value="payment.status" />
			</van-cell-group>
			<div style="margin: 16px;">
			  <van-button round block type="info" @click="goto">分期列表</van-button>
			</div>
		</div>
		<tabbar></tabbar>
		<div style="height: 3rem;"></div>
	</div>
	
</template>

<script>
	import tabbar from '../../src/components/tarbar.vue'
	import store from '../../common/store.js'
	import { Toast } from 'vant';
	export default {
	  data() {
	    return {
	         userId:'sdsd',
			 projectService:{
				 name:'',
				 amount:''
			 },
			 paymentOptions:{
				 name:''
			 },
			 payment:{
				 status:''
			 },
			 paymentItems:{
				 
			 }
	    };
	  },
	  components: {
	    tabbar,
	  },
	  methods: {
		  goto:function(){
			  this.$router.push({
				  name:'paymentInfo'
			  })
		  },
		  search:function(){
			  this.http.get({
				  url:`/system/student/payment/${this.$data.userId}`
			  }).then((data) => {
				  this.$data.projectService.name = data.projectService.name
				  this.$data.projectService.amount = data.projectService.amount
				  this.$data.paymentOptions.name = data.paymentOptions.name
				  this.$data.payment.status = data.payment.status
				  
			  })
			  
		  }
	  },
	  mounted() {
	  	this.$data.userId = this.$data.currentUser.user.userId
	  		this.search()
	  },
	  computed: {
	  	current: function() {
	  		this.$data.currentUser = store.state.currentUser
	  		return store.state.currentUser
	  	},
	  },
	};
	
</script>

<style scoped>
	h3{
		margin:10px;
		text-align: center;
		
	}
</style>
